<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>table模块快速使用</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
  <link rel="stylesheet" href="../iten-icon/iten-icon.css"  media="all">
  <link rel="stylesheet" href="css/layui.css"  media="all">
  <style>
	.layui-treeGrid-indent{
		width: 16px;
		height: 16px;
		display: block;
		float: left;
	}
	.layui-treeGrid-expander{
		width: 16px;
		height: 16px;
		display: block;
		float: left;
		cursor: pointer;
	}
	.layui-treeGrid-expander:after {
		display: block;
		font-family: "iten-icon" !important;
	}
	.layui-treeGrid-expander:after{
		content: "\e604";
	}
	.layui-treeGrid-expanded .layui-treeGrid-expander:after{
		content: "\e606";
	}
  </style>
</head>
<body>
 
<table id="demo" lay-filter="test"></table>
 
<script src="layui.js"></script>
<script>
layui.use('treeTable', function(){
  var table = layui.treeTable;
  
  //第一个实例
  table.render({
    elem: '#demo'
    ,height: 600
    ,url: 'data.json' //数据接口
	,treeExpand:true
    ,page: true //开启分页
    ,cols: [[ //表头
	   {type: 'checkbox', width:50}
      ,{field: 'id', title: 'ID', width:200}
      ,{field: 'username', title: '用户名', width:80, edit:"text"}
      ,{field: 'sex', title: '性别', width:80}
	  ,{field: 'parentId', title: '父ID', width:80}
    ]]
  });
});
</script>
</body>
</html>